#ifndef CHRONOMETER_H
#define CHRONOMETER_H

#include <QtCore>

class Chronometer
{
public:
	Chronometer(QString name = QString("Duration:"), bool silent = false);
	~Chronometer();

	quint64 elapsedMs();
	quint64 elapsedFromLastMs();
	void showElapsedText(QString suffix);
	QString elapsedText(QString suffix);
	// resolution can be d, h, m, s, ms
	static QString durationToString(quint64 ms, QString resolution = "ms");

	static qint64 currentTimeMs();

private:
	QString name;
	quint64 tStart;
	quint64 tLast;
	bool silent;
};

#endif // CHRONOMETER_H
